<?

require_once ("application.fieldset.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;

$fieldset_users = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"users",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$_REQUEST["user_id"],
				input=>"hidden",primary_key=>true),
		array (name=>"first",label=>"First",type=>"character",
				excluded=>true,
				disabled=>true,
				input=>"field"),
		array (name=>"last",label=>"Last",type=>"character",
				excluded=>true,
				disabled=>true,
				input=>"field"),
		/* array (name=>"access",label=>"User Access",type=>"character",
				input=>"select",
				value=>"public",
				options=>array (
					array (id=>"public",name=>"Public"),
					array (id=>"private",name=>"Private"),
					array (id=>"exclusive",name=>"Exclusive"),
				),
				columns=>array(key=>"id",value=>"name"),
		), */
		array (name=>"status",label=>"User Status",type=>"character",
				input=>"select",
				excluded=>true,
				disabled=>true,
				value=>"new",
				options=>array (
					array (id=>"active",name=>"Active"),
					array (id=>"inactive",name=>"Inactive"),
					array (id=>"hold",name=>"Hold"),
					array (id=>"suspended",name=>"Suspended"),
					array (id=>"processing",name=>"Processing"),
					array (id=>"new",name=>"New"),
					array (id=>"assigned",name=>"Assigned"),
					array (id=>"started",name=>"Started"),
					array (id=>"stopped",name=>"Stopped"),
					array (id=>"complete",name=>"Complete"),
				),
				columns=>array(key=>"id",value=>"name"),
		),
	)
));

$fieldset_users->parse ();

$return = "/fs_projects.php?fs_action=view&fs_tab=users&project_id={$_REQUEST["project_id"]}&user_id={$_REQUEST["user_id"]}";

$fs_options = array (
	/* addnew=>array (label=>"Add New"),
	create=>array (label=>"Create"),
	modify=>array (label=>"Modify"),
	remove=>array (label=>"Remove"),
	update=>array (label=>"Update"),
	cancel=>array (label=>"Cancel"),
	delete=>array (label=>"Delete",
			redirect=>dirname ($_SERVER["PHP_SELF"]) . $return),
	canret=>array (label=>"Cancel",
			redirect=>dirname ($_SERVER["PHP_SELF"]) . $return),
	close=>array (label=>"Close",
			redirect=>dirname ($_SERVER["PHP_SELF"]) . $return), */
);

$image_options = array (size=>$_REQUEST["_img_size"]);

list ($fs_input, $fs_action, $store, $valid, $success) =

	_app_process_fieldset (array (
		fieldset=>$fieldset_users,
		fs_options=>$fs_options,
		fs_primary_key=>"user_id",
		fs_action=>($_REQUEST["fs_action"] ?
				$_REQUEST["fs_action"] :
				"view"),
));

$_OBJECT_FIELDSET_CONTROL =_app_create_fieldset_object (array (
	fieldset_id=>"fs_project_users",
	db_conn=>$_GLOBAL_DBH,
	fieldset=>$fieldset_users,
	fs_action=>$fs_action,
	fs_title=>"&nbsp;&raquo;&nbsp;Project User",
	fs_input=>$fs_input,
	fs_link=>"fs_projects.php?fs_action=view&fs_tab=users&fs_tab_option=fs_users&project_id={$_REQUEST["project_id"]}",
	fs_options=>$fs_options,
));

$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_FIELDSET_CONTROL);

if (isset ($_REQUEST["user_id"]) && $_REQUEST["user_id"] > 0)

	require_once ("fs_user_tabs.inc");

?>
